
import { defineStore } from 'pinia'
import type { DatePickerProps } from 'naive-ui'
import type { Ref } from 'vue'

export const useDateRangeStore = defineStore('dateRange', {
    state: () => ({
        visible: false,
        range: null as DatePickerProps['value'] | null
    }),
    actions: {
        showModal() {
            this.visible = true
        },
        confirmRange(range: DatePickerProps['value']) {
            alert(range)
            this.range = range
            this.visible = false
        }
    }
})